package kr.hkit.powerjava.chapter22.work2;

import java.util.*;

import kr.hkit.powerjava.chapter23.*;

public class Test {
	public static void main(String[] args) {
		Map<Integer, Department> dptList = new HashMap<>();
		
		dptList.put(1, new Department(1, "컴터",3));
		dptList.put(2, new Department(2, "체육",4));
		dptList.put(3, new Department(3, "원예",1));
		dptList.put(4, new Department(4, "미술",2));
		
		dptList.remove(1);
		
	
		dptList.put(1, new Department(5,"도예",4));
		
		for(Map.Entry<Integer, Department> s : dptList.entrySet()){
			Integer key = s.getKey();
			Department value = s.getValue();
			System.out.println("학과번호 : " + key +" 학과명 : " + value);
		}

		
		Map<Integer, Integer> m = new HashMap<>();
		int[] jumsu = {91,90,92,80,88, 79,67,20,30,10,40};
		
		for(int a: jumsu){
			Integer r = m.get(a/10);
			m.put(a/10, (r==null)?1:r+1);
		}
		System.out.println(Arrays.toString(jumsu));
		for(Map.Entry<Integer, Integer>list : m.entrySet()){
			System.out.println(list.getKey()*10 + "점대" + list.getValue() +"명");
		}
		
		
		
		
		
	}
}
